{block name=partner}
<div id="partner_wrapper{$partnerno}" rel="{$partnerno}" class="partner sub-form">
	<div class="row" >
		<div class="col-sm-8">
			<fieldset>
				<legend style="font-size:17px;">
					<div id="admin_image_{$partnerno}_preview">{if $users.admin_image}<img src="{$users.admin_image}" alt="img{$partnerno}" height="50px" width="50px">{/if}</div>
					<div id="admin_name_{$partnerno}_preview">{if $users.admin_name}{$users.admin_name}{else}User #{$partnerno}{/if}</div>
				</legend>
			</fieldset>
		</div>
		<div class="col-sm-2">
			<a href="javascript:void(0);" class="btn btn-warning trainer-btn" onclick="togglePartner('{$partnerno}')">显示 / 隐藏</a>
		</div>
		<div class="col-sm-2">
			<a href="javascript:void(0);" class="btn btn-danger del-btn" onclick="deletePartner('partner_wrapper{$partnerno}')">删除</a>
		</div>
	</div>
	<div class="row partners" id="partner{$partnerno}">
		<div class="row form-group">
			<label class="col-sm-3 control-label" for="admin_image{$partnerno}_link">图片<br><small>尺寸: 120px宽 * 130px高</small></label>
			<div class="col-sm-9">
				
				<input type="hidden" value="admin_id" name="field[{$partnerno*10}][tbl_admin][{$partnerno}][id]" />
				<input type="hidden" value="{$users.admin_id}" name="field[{$partnerno*10}][tbl_admin][{$partnerno}][admin_id]" id="admin_id_{$partnerno}">
				<input type="hidden" value="{$users.admin_image}" name="field[{$partnerno*10}][tbl_admin][{$partnerno}][admin_image]" id="admin_image_{$partnerno}_link" class="fileinput"> 
				<span class="file-view" id="admin_image_{$partnerno}_path">{if $users.admin_image}<a href="{$users.admin_image}" target="_blank" >查看</a>{else}暂无{/if}</span> 
				<a href="javascript:void(0);" class="btn btn-info marg-5r" onclick="getFileType('admin_image_{$partnerno}','','');">选择文件</a> 
				<a href="javascript:void(0);" class="btn btn-info" onclick="$('#admin_image_{$partnerno}').val('');$('#admin_image_{$partnerno}_link').val('');$('#admin_image_{$partnerno}_path').html('None');$('#admin_image_{$partnerno}_preview').html('');">移除文件</a>
			</div>
		</div>
		<div class="row form-group">
			<label class="col-sm-3 control-label" for="admin_name_{$partnerno}">* 姓名</label>
			<div class="col-sm-5">
				<input class="form-control" type="text" value="{$users.admin_name}" name="field[{$partnerno*10}][tbl_admin][{$partnerno}][admin_name]" id="admin_name_{$partnerno}" onchange="$('#admin_name_{$partnerno}_preview').html(this.value);" required>
			</div>
		</div>
 
<!-- 		<div class="row form-group">
			<label class="col-sm-3 control-label" for="admin_surname_{$partnerno}">Surname</label>
			<div class="col-sm-5">
				<input class="form-control" type="text" value="{$users.admin_surname}" name="field[{$partnerno*10}][tbl_admin][{$partnerno}][admin_surname]" id="admin_surname_{$partnerno}" >
			</div>
		</div> -->
		
		<div class="row form-group">
			<label class="col-sm-3 control-label" for="admin_email_{$partnerno}">* 邮箱</label>
			<div class="col-sm-5">
				<input class="form-control admin-email" type="email" onfocus="SetValidator()" data-admin-id="#admin_id_{$partnerno}" value="{$users.admin_email}" name="field[{$partnerno*10}][tbl_admin][{$partnerno}][admin_email]" id="admin_email_{$partnerno}" onchange="$('#admin_username_{$partnerno}').val(this.value);createPassword('admin_email_{$partnerno}','password_{$partnerno}','admin_password_{$partnerno}');" autocomplete=off required>
				<span class="help-block"></span>
			</div>
		</div>
		
		<div class="row form-group">
			<label class="col-sm-3 control-label" for="admin_telephone_{$partnerno}">手机</label>
			<div class="col-sm-5">
				<input class="form-control" type="text" value="{$users.admin_telephone}" name="field[{$partnerno*10}][tbl_admin][{$partnerno}][admin_telephone]" id="admin_telephone_{$partnerno}" >
			</div>
		</div>
		
		<div class="row form-group">
			<label class="col-sm-3 control-label" for="password_{$partnerno}">* 密码</label>
			<div class="col-sm-5">
				<input type="hidden" value="{$users.admin_username}" name="field[{$partnerno*10}][tbl_admin][{$partnerno}][admin_username]" id="admin_username_{$partnerno}"> 
					<input type="hidden" value="{$users.admin_password}" data-password="{$users.admin_password}" name="field[{$partnerno*10}][tbl_admin][{$partnerno}][admin_password]" id="admin_password_{$partnerno}">
				<input class="form-control" type="password" value="" name="field1" id="password_{$partnerno}" onchange="createPassword('admin_email_{$partnerno}','password_{$partnerno}','admin_password_{$partnerno}');" autocomplete="off">
				<span class="help-block"></span>
			</div>
		</div>
						
		<div class="row form-group">
			<label class="col-sm-3 control-label" for="admin_level_{$partnerno}">成员类型</label>
			<div class="col-sm-5">
				<select class="form-control" name="field[{$partnerno*10}][tbl_admin][{$partnerno}][admin_level]" id="admin_level_{$partnerno}">
						<option value="2" {if $users.admin_level eq 2}selected="selected"{/if}>加盟商</option>
						<option value="3" {if $users.admin_level neq 1 && $users.admin_level neq 2}selected="selected"{/if}>教师</option> 
				</select>
			</div>
		</div>
		<div class="row form-group">
			<label class="col-sm-3 control-label" for="admin_description_{$partnerno}">描述</label>
			<div class="col-sm-5">
				<textarea class="form-control" maxlength="300" rows="4" name="field[{$partnerno*10}][tbl_admin][{$partnerno}][admin_description]" id="admin_description_{$partnerno}" >{$users.admin_description}</textarea>
			</div>
		</div> 
		<input type="hidden" value="franchisee_object_id" name="default[access_franchisee_id]" />
		<input type="hidden" value="admin_id" name="default[access_admin_id]" />
		<input type="hidden" value="access_id" name="field[{$partnerno*10+1}][tbl_access][{$partnerno}][id]" />
		<input type="hidden" value="{$users.access_id}" name="field[{$partnerno*10+1}][tbl_access][{$partnerno}][access_id]" >
		<input type="hidden" value="1" name="field[{$partnerno*10+1}][tbl_access][{$partnerno}][access_flag]" >
		<input type="hidden" value="{$users.access_franchisee_id}" name="field[{$partnerno*10+1}][tbl_access][{$partnerno}][access_franchisee_id]" class="key">
		<input type="hidden" value="{$users.access_admin_id}" name="field[{$partnerno*10+1}][tbl_access][{$partnerno}][access_admin_id]" class="key">
		<div class="row form-group">
			<div class="col-sm-8">
				<a href="javascript:void(0);" onClick="setFormCallback('{$partnerno}')" class="btn btn-info pull-right top-btn"><span class="glyphicon glyphicon-envelope"></span> 保存并通知</a>
			</div>
			<div class="col-sm-4"></div>
			<div class="col-sm-5 col-sm-offset-3 text-info"><small><br>添加一个PDF附件到加盟欢迎邮件请使用名称"welcome-rsgk.pdf"保存文档，并将PDF上传到文件管理器中的 Uploads -> pdfs 文件夹。</small></div>
		</div>
	</div>
</div>
{/block}